﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DesignPatternDemo.里氏替换原则
{
    /// <summary>
    /// 里氏替换
    /// </summary>
    public class LishiReplace
    {
        public void Do()
        {
            Father father = new Father();
            father.Dosomething(new Jappan());
           

            Son son = new Son();
            son.Dosomething(new China());

        }
    }


    public class Father
    {
        public  void Dosomething(China china)
        {
            Console.WriteLine("this is your father");
        }
    }


    public class Son :Father{

        public void Dosomething(Jappan jappan)
        {
            Console.WriteLine("this is son!");
        }
    }



    public class China
    {
        public string Doner { get; set; }
    }

    public class Jappan : China { }
}
